<a href=" 正则表达式 请高手帮忙写一下,除去http:
来源:百度知道 编辑:UC知道 时间:2024/06/07 19:36:39
从网页中提取 <a href=" 的正则表达式 请高手帮忙写一下,除去http:结尾的.
急75分等答案
http是接的网址.
我想找出超连接,但是不找含有网址的超连接.
只找相对路经的超联接.
网页中有 <a href="index.html
<a href="class.html
<a href="http://www.baidu.com
现在要找出 <a href="index.html
<a href="class.html
替换成
<a href="../index.html
<a href="../class.html
急75分等答案
http是接的网址.
我想找出超连接,但是不找含有网址的超连接.
只找相对路经的超联接.
网页中有 <a href="index.html
<a href="class.html
<a href="http://www.baidu.com
现在要找出 <a href="index.html
<a href="class.html
替换成
<a href="../index.html
<a href="../class.html
在EmEditor下测试通过:
正则式: <a href="(?=.*?\.html)
替换为: <a href="../
测试文本:
<a href="index.html
<a href="class.html
<a href="http://www.baidu.com
测试结果:
<a href="../index.html
<a href="../class.html
<a href="http://www.baidu.com
其实完全可以写成:(?<=<a href=")(?=.*?\.html)
但是EmEditor不支持(?<=pattern)的语法。
<a href=".*?">
http:结尾的是什么意思?
2楼
你那个有个小bug
如果是 http://www.baidu.com/a.html
就不行了
改进了下
正则 <a href="(((?!http).)+) 替换成 <a href="../$1
<a href=" ----- 怎样改成双击进行链接?
<a href="Untitled-3.htm
<a href="?">自身</a> 和 <a href="#">自身</a> 有什么区别?
<a href=" ? &noedit=1" </a>中的问号是什么意思
<a href="#">***</a>的问题
<a href="#" onClick="if(window.confirm...这句话有错吗
<a href="../news/more.asp?type=a
<a href="action.asp"?><%=rs(1).value%></a>
<a href="do_modify.asp?xuehao=<%rs(学号)%">修改</a>
如果<a href="ABC">里ABC是个变量,怎么办?